<include file="Public:header" />
<!--修改会员信息-->
<form id="info_form" action="{:U('User/userUpdate')}" method="post" enctype="multipart/form-data">
<div class="pad_lr_10">
	<div class="col_tab">
		<ul class="J_tabs tab_but cu_li">
			<li class="current">会员信息</li>
		</ul>
		<div class="J_panes">
			<div class="content_list pad_10">
				<table width="100%" cellspacing="0" class="table_form">
					<tr>
						<th width="120">选择分类 :</th>
						<td>
                            <select class="J_cate_select mr10" data-pid="0" data-uri="{:U('UserCate/ajax_getchilds')}" data-selected="{$selected_ids}"></select>
                            <input type="hidden" name="userInfo[cate_id]" id="J_cate_id" value="" />
                        </td>
					</tr>
                    <tr>
                        <th>会员头像 :</th>
                        <td>
                            <a href="{$userInfo.head_ico}" target="_blank"><img src="{$userInfo.head_ico}" style="width: 100px;height: 80px;"></a>
                        </td>
                    </tr>
		            <tr>
						<th>用户名 :</th>
						<td>
							<input type="text" name="username" disabled="disabled" class="input-text" value="{$user.username}" size="20">
                        </td>
					</tr>
                    <tr>
                        <th>E-mail :</th>
                        <td><input type="text" name="user[email]" disabled="disabled" class="input-text" value="{$user.email}" size="20"></td>
                    </tr>
                    <tr>
                        <th>手机号 :</th>
                        <td><input type="text" name="user[mobile]" disabled="disabled" class="input-text" value="{$user.mobile}" size="20"></td>
                    </tr>
                    <tr>
                        <th>积分 :</th>
                        <td>
                            <select name="account[pointtype]" id="apoint">
                                <option value="setinc">增加</option>
                                <option value="setdesc">减少</option>
                            </select>
                            <input type="text" name="account[point]" class="input-text" size="5" />
                            <span>可用积分：{$account.point}</span>
                        </td>
                    </tr>
                    <tr>
                        <th>金钱 :</th>
                        <td>
                            <select name="account[moneytype]" id="amoney">
                                <option value="setinc">增加</option>
                                <option value="setdesc">减少</option>
                                <option value="freeze">冻结</option>
                                <option value="unfreeze">解冻</option>
                            </select>
                            <input type="text" name="account[money]" class="input-text" size="5" />
                            <span>可用余额：{$account.blance},冻结余额：{$account.freeze}</span>
                        </td>
                    </tr>
                    <tr>
                        <th>真实姓名 :</th>
                        <td><input type="text" name="info[true_name]" class="input-text" value="{$userInfo.true_name}" size="20"></td>
                    </tr>
                    <tr>
                        <th>性别 :</th>
                        <td>
                            <label><input type="radio" name="info[sex]" class="radio_style" value="1" <if condition="$userInfo['sex'] eq '1'">checked="checked"</if>> 男 </label>&nbsp;&nbsp;
                            <label><input type="radio" name="info[sex]" class="radio_style" value="2" <if condition="$userInfo['sex'] eq '2'">checked="checked"</if>> 女</label>
                        </td>
                    </tr>
                    <tr>
                        <th>证件类型 :</th>
                        <td>
                            <select name="info[id_type]">
                                <volist name="conf['id_type']" id='vo'>
                                    <option <php>if($userInfo['id_type']==$key){</php> selected="selected" <php>}</php> value="{$key}">{$vo}</option>
                                </volist>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <th>证件号码:</th>
                        <td><input type="text" name="info[id_code]" value="{$userInfo.id_code}" size="40" class="input-text"></td>
                    </tr>
                    <!--tr>
                        <th>教程程度 :</th>
                        <td>
                            <select id="edu" name="info[edu_level]">
                                <option value="0">请选择</option>
                                <volist name="conf['edu']" id='vo'>
                                    <option <php>if($userInfo['edu_level']==$key){</php> selected="selected" <php>}</php> value="{$key}">{$vo}</option>
                                </volist>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <th>职业 :</th>
                        <td>
                            <select id="job" name="info[occupation]">
                                <option value="0">请选择</option>
                                <volist name="conf['job']" id='vo'>
                                    <option <php>if($userInfo['occupation']==$key){</php> selected="selected" <php>}</php> value="{$key}">{$vo}</option>
                                </volist>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <th>职务 :</th>
                        <td><input type="text" name="info[duties]" class="input-text" value="{$userInfo.duties}" size="20"></td>
                    </tr-->
                    <tr>
                        <th>公司名称 :</th>
                        <td><input type="text" name="info[company_name]" class="input-text" value="{$userInfo.company_name}" size="40"></td>
                    </tr>
                    <tr>
                        <th>购房热线 :</th>
                        <td><input type="text" name="info[hot_line]" class="input-text" value="{$userInfo.hot_line}" size="20"></td>
                    </tr>

                    <tr>
                        <th>qq :</th>
                        <td><input type="text" name="info[qq]" class="input-text" value="{$userInfo.qq}" size="20"></td>
                    </tr>
                    <tr>
                        <th>联系地址 :</th>
                        <td><input type="text" name="info[address]" class="input-text" value="{$userInfo['address']}" size="40"></td>
                    </tr>
                    <tr>
                        <th>选择分组 :</th>
                        <td>
                            <select name="shop" id="shop">
                                <option value="0">选择店铺</option>
                                <volist name="shops" id="vo">
                                    <option value="{$vo.id}">{$vo.title}</option>
                                </volist>
                            </select>
                            <select name="info[group]" id="group">
                                <option value="0">选择分组</option>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <th>状态 :</th>
                        <td>
                            <select name="exmp[status]" id="status">
                                <option value="0" <if condition="$user['status'] eq 0"> selected="selected"</if>>待审核</option>
                                <option value="1"<if condition="$user['status'] eq 1"> selected="selected"</if> >已审核</option>
                                <option value="2"<if condition="$user['status'] eq 2"> selected="selected"</if> >离职</option>
                            </select>
                        </td>
                    </tr>
                    <input type="hidden" name="id" value="{$user.id}"/>
				</table>
            </div>
        </div>
		<div class="mt10"><input type="submit" value="{:L('submit')}" id="dosubmit" name="dosubmit" class="btn btn_submit" style="margin:0 0 10px 100px;"><br /><br /><br /></div>
	</div>
</div>
</form>
<include file="Public:footer" />
<script>
    $('.J_cate_select').cate_select('请选择');

</script>
<script src="__STATIC__/js/formvalidator.js"></script>
<script>
    $(function(){
        $.formValidator.initConfig({formid:"info_form",autotip:true});
        $("#J_cate_id").formValidator({onshow:"请选择分类",onfocus:"请选择分类"}).regexValidator({regexp:"intege1",datatype:"enum",onerror:"请选择分类"});
        //$("#username").formValidator({onshow:'请填写用户名',onfocus:'用户名应由3-16个字母或数字组成'}).inputValidator({min:3,onerror:'至少为3个字符'}).regexValidator({regexp:"ps_username",datatype:"enum",onerror:"用户名格式不正确"});
       // $("#email").formValidator({onshow:"请输入邮箱",onfocus:"邮箱格式错误",oncorrect:"邮箱格式正确"}).inputValidator({min:2,max:32,onerror:"邮箱应该为2-32位之间"}).regexValidator({regexp:"email",datatype:"enum",onerror:"邮箱格式错误"});
        $("#group").formValidator({onshow:"请选择分组",onfocus:"请选择分组",oncorrect:""});
    });
    $('#shop').change (function (){
        var shop_id = $(this).val();
        var url = "{:U('division/ajax_get_group')}",
            data = {shop_id:shop_id};
        $.post(url, data, function (reponse){
            if (typeof (reponse) != 'undefined'){
                var html = '';
                $.each (reponse, function (index, obj){
                    html += "<option value='"+obj.id+"'>"+obj.title+"</option>";
                })
                $("#group option[index=0]").nextAll('option').remove();
                $('#group').append(html);
            }
        }, 'json');

    });
    $('#status').change (function (){
        var group = $('#group').val();
        var state = $(this).val();
        if (state == 1 && group == 0){
            alert ('请把用户分组后再完成审核');
            $(this).val('0');
        }
    });

</script>
</body>
</html>